<?php
namespace app\admin\validate;

use think\Validate;

class question extends Validate
{
    protected $rule = [
        'question' => 'require|min:1',
        'username' => 'require|min:1',
        'password' => 'require|min:6',
        'repassword' => 'require|confirm:password',
        'email' => 'email|unique:member',
        'mobile' => 'require|/^1[34578]\d{9}$/|unique:member',
    ];

    protected $message = [
        'username.require' => '{%username_require}',
        'username.min' => '{%username_min}',
        'username.unique' => '{%username_unique}',
        'password' => '{%password_val}',
        'password.min' => '{%password_min}',
        'repassword' => '{%repassword_val}',
        'email' => '{%email_val}',
        'email.unique' => '{%email_unique}',
        'mobile' => '{%moblie_val}',
        'mobile.unique' => '{%moblie_unique}',
    ];

    protected $scene = [
        'add'   => ['jid','question', 'is_disable'],
        'jid'   => ['jid'],
        'qid'   => ['qid','jid','answer','score','is_check'],
        'edit'  => ['question'],
        'password' => ['password', 'repassword'],
        'username'=>['username'],
        'is_check'=>['is_check'],
		'is_disable'=>['is_disable'],
    ];
}